package com.ruoyi.web.controller.teaching;


import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.teaching.domain.PlatformMMap;
import com.ruoyi.teaching.service.PlatformMMapService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王旭
 * @since 2024-10-12
 */
@RestController
@RequestMapping("/platform/map")
@Api(tags = "platform-全景地图管理")
public class PlatformMMapController {

    @Autowired
    private PlatformMMapService platformMMapService;

    /**
     * 查询所有全景地图列表
     */
    @GetMapping("/panoramaMapList")
    @ApiOperation(value = "查询所有全景地图列表", notes = "查询所有全景地图列表")
    public AjaxResult panoramaMapList(Integer pageNum, Integer pageSize, String message, Long mapType) {
        return platformMMapService.panoramaMapList(pageNum, pageSize, message, mapType);
    }

    /**
     * 查找某个全景观地图及他所有的点位
     */
    @GetMapping("/panoramaMapAndPoints")
    @ApiOperation(value = "查找某个全景观地图及他所有的点位", notes = "查找某个全景观地图及他所有的点位")
    public AjaxResult panoramaMapAndPoints(Long id) {
        return platformMMapService.panoramaMapAndPoints(id);
    }

    /**
     * 新增全景地图或点位
     */
    @PostMapping("/addMapOrPoints")
    @ApiOperation(value = "新增全景地图或点位", notes = "新增全景地图或点位")
    @Log(title = "【新增全景地图或点位】", businessType = BusinessType.INSERT)
    public AjaxResult addMapOrPoints(@RequestBody PlatformMMap platformMMap) {
        return platformMMapService.addMapOrPoints(platformMMap);
    }

    /**
     * 修改全景地图或点位
     */
    @PutMapping("/updateMapOrPoints")
    @ApiOperation(value = "修改全景地图或点位", notes = "修改全景地图或点位")
    @Log(title = "【修改全景地图或点位】", businessType = BusinessType.UPDATE)
    public AjaxResult updateMapOrPoints(@RequestBody PlatformMMap platformMMap) {
        return platformMMapService.updateMapOrPoints(platformMMap);
    }

    /**
     * 删除全景地图或点位
     */
    @DeleteMapping("/delete/{ids}")
    @ApiOperation(value = "删除全景地图或点位", notes = "删除全景地图或点位")
    @Log(title = "删除全景地图或点位", businessType = BusinessType.DELETE)
    public AjaxResult deleteMapOrPoints(@PathVariable("ids") Long[] ids) {
        return platformMMapService.deleteMapOrPoints(ids);
    }

}

